package Models

type GZShowSwitch struct { // 默认操作的是这张表的复数
	Id         int64  `json:"id" gorm:"primary_key"`
	Title      string `json:"title" gorm:"size:50"`
	SwitchType string `json:"switch_type"`
	IsEnable   int    `json:"is_enable" gorm:"commit:'是否可用（0为不可用，1为可用'"`
	Closed     int64  `json:"closed"`
	CreatedAt  int64  `json:"create_time"`
	UpdatedAt  int64  `json:"update_time"`
}

func (GZShowSwitch) TableName() string {
	return "gz_show_switch"
}

func GetSwitchValueByType(clu string) GZShowSwitch {
	cfg := GZShowSwitch{}
	DB.Where("switch_type = ?", clu).Find(&cfg)
	return cfg
}
